﻿Public Class TinhTrangXe
    Public Shared Function them(ByVal mota As String)
        mota = EscapeString(mota)
        Return db.Query("INSERT INTO TinhTrangXe(MoTa) VALUES(N'" + mota + "')")
    End Function
    Public Shared Function dstt() As DataTable
        Return db.QueryTable("SELECT * FROM TinhTrangXe")
    End Function
    Public Shared Function capnhat(ByVal matt As String, ByVal mota As String)
        matt = EscapeString(matt)
        mota = EscapeString(mota)
        Return db.Query("UPDATE TinhTrangXe SET MoTa = N'" + mota + "' WHERE MaTT = '" + matt + "'")

    End Function
    Public Shared Function xoa(ByVal matt As String)
        matt = EscapeString(matt)
        Return db.Query("DELETE FROM TinhTrangXe WHERE MaTT = '" + matt + "'")
    End Function
    Public Shared Function timkiem(ByVal tukhoa As String) As DataTable
        tukhoa = EscapeString(tukhoa)
        Return db.QueryTable("SELECT * FROM TinhTrangXe WHERE MaTT like '%" + tukhoa + "%' or MoTa like '%" + tukhoa + "%'")

    End Function
End Class
